package com.stlm2.dems.entity.base;

import com.stlm2.dems.entity.CommissionSource;
import com.stlm2.dems.entity.CommissionType;
import com.stlm2.dems.user.entity.UserLevel;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Author：fuchunyu
 * Date：2017/9/13
 * Description：
 */
public class BaseCommission {

    private Integer id;
    private Integer year;
    private Integer month;
    private Integer upperUserId;
    private Integer lowerUserId;
    private CommissionType commissionType;
    private CommissionSource commissionSource;
    private String referCode;
    private BigDecimal orderMoney;
    private BigDecimal commissionRate;
    private BigDecimal money;
    private UserLevel userLevel;
    private Date createTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }


    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    public Integer getMonth() {
        return month;
    }

    public void setMonth(Integer month) {
        this.month = month;
    }

    public Integer getUpperUserId() {
        return upperUserId;
    }

    public void setUpperUserId(Integer upperUserId) {
        this.upperUserId = upperUserId;
    }

    public Integer getLowerUserId() {
        return lowerUserId;
    }

    public void setLowerUserId(Integer lowerUserId) {
        this.lowerUserId = lowerUserId;
    }

    public CommissionType getCommissionType() {
        return commissionType;
    }

    public void setCommissionType(CommissionType commissionType) {
        this.commissionType = commissionType;
    }

    public CommissionSource getCommissionSource() {
        return commissionSource;
    }

    public void setCommissionSource(CommissionSource commissionSource) {
        this.commissionSource = commissionSource;
    }

    public String getReferCode() {
        return referCode;
    }

    public void setReferCode(String referCode) {
        this.referCode = referCode;
    }

    public BigDecimal getOrderMoney() {
        return orderMoney;
    }

    public void setOrderMoney(BigDecimal orderMoney) {
        this.orderMoney = orderMoney;
    }

    public BigDecimal getCommissionRate() {
        return commissionRate;
    }

    public void setCommissionRate(BigDecimal commissionRate) {
        this.commissionRate = commissionRate;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public UserLevel getUserLevel() {
        return userLevel;
    }

    public void setUserLevel(UserLevel userLevel) {
        this.userLevel = userLevel;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 映射：分佣类型
     */
    public Integer getCommissionTypeValue() {
        return (commissionType != null) ? commissionType.getIntValue() : null;
    }

    public void setCommissionTypeValue(Integer value) {
        if (value != null)
            this.commissionType = CommissionType.getByIntValue(value);
    }

    /**
     * 映射：分佣来源
     */
    public Integer getCommissionSourceValue() {
        return (commissionSource != null) ? commissionSource.getIntValue() : null;
    }

    public void setCommissionSourceValue(Integer value) {
        if (value != null)
            this.commissionSource = CommissionSource.getByIntValue(value);
    }

    public Integer getUserLevelValue() {
        return (userLevel != null) ? userLevel.getIntValue() : null;
    }

    public void setUserLevelValue(Integer value) {
        if (value != null)
            this.userLevel = UserLevel.getByIntValue(value);
    }
}
